package com.own.testapp.module;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import com.own.testapp.R;
import com.own.testapp.base.BaseNetActivity;
import com.own.testapp.utils.TextUtil;
import com.own.testapp.utils.ToastUtils;
import com.own.testapp.utils.UIHelper;

public class RegisterActivity extends BaseNetActivity
{
    private EditText et_user_register,et_psw_register;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);

        et_user_register = (EditText) findViewById(R.id.et_user_register);
        et_psw_register = (EditText) findViewById(R.id.et_psw_register);
    }

    /**
     * 注册用户
     * @param view
     */
    public void onRegisterUser(View view){
        String userContent = et_user_register.getText().toString();
        String pswContent =  et_psw_register.getText().toString();
        if (TextUtil.isEmpty(userContent) || TextUtil.isEmpty(pswContent)){
            ToastUtils.showShort(mCotext,"用户名或密码不能为空");
            return;
        }

        UIHelper.startActivityWithClearTop(mCotext,LoginActivity.class);
    }
}
